package com.pro.dao.impl;

import java.sql.SQLException;
import java.util.ArrayList;

import com.pro.entity.ProductImgEntity;
import com.pro.util.DBManager;
import com.pro.util.QueryResult;

public class ProductImgDaoImpl {
	public ArrayList<ProductImgEntity> productImg(){
		ArrayList<ProductImgEntity> alist= new ArrayList<ProductImgEntity>();
		String sqlString="select id,create_time,img,gid from product_img";
	    QueryResult rSet=DBManager.executeQuery(sqlString);
	      if (rSet!=null) {
	        try {
	          while (rSet.rs.next()) {
	        	  alist.add(new ProductImgEntity(rSet.rs.getInt("id"),
	            		rSet.rs.getDate("create_time"),
	            		rSet.rs.getString("img"),
	            		rSet.rs.getInt("gid")));
	          }
	        } catch (SQLException e) {
	          e.printStackTrace();
	        }
	      }
	      rSet.close();
	    return alist;
	}
}
